# 用户名、密码、黑名单

# DICT
account = [
    {"name": "张三", "password": "123", "status": True},
    {"name": "李四", "password": "456", "status": True},
    {"name": "王五", "password": "789", "status": False}  # 黑名单
]
print(type(account))
flag = False
for j in range(3):
    user = input("用户名：")
    pwd = input("密码：")
    for i in account:
        if user == i['name']:
            if pwd == i['password']:
                if i['status']:
                    print("登录成功")
                    flag = True
                else:
                    print("该用户在黑名单内，请联系管理员")
            else:
                print("密码错误，请重试")
            break
    else:  # break没有执行过
        print("用户名不存在，请先注册")
    if flag:
        break
